package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.LoadConstantInstructionBytecodeEvent;

public class LoadConstantInstructionBytecodeEventImpl extends BytecodeEventImpl implements
    LoadConstantInstructionBytecodeEvent
{
    private Object constant;

    public LoadConstantInstructionBytecodeEventImpl(final Object aConstant) {
        constant = aConstant;
    }

    @Override
    public int getType() {
        return LOAD_CONSTANT_INSTRUCTION;
    }

    @Override
    public void setConstant(final Object aConstant) {
        constant = aConstant;
    }

    @Override
    public Object getConstant() {
        return constant;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeMethodVisitor().visitLoadConstantInstruction(this);
        return aBytecodeVisitor;
    }
}
